# Create your views here.
from rest_framework.generics import ListAPIView

from .models import Banner
from .serializers import BannerModelSerializer, NavModelSerializer
from luffyapi.settings import constants


class BannerListAPIView(ListAPIView):
    queryset = Banner.objects.filter(is_show=True, is_deleted=False).order_by("orders","-id")[:constants.HOME_BANNER_LENGTH]
    serializer_class = BannerModelSerializer


from .models import Nav


class NavHeaderListAPIView(ListAPIView):
    queryset = Nav.objects.filter(is_show=True, is_deleted=False, position=1).order_by("orders","-id")[:constants.Header_BANNER_LENGTH]
    serializer_class = NavModelSerializer


class NavFooterListAPIView(ListAPIView):
    queryset = Nav.objects.filter(is_show=True, is_deleted=False, position=1).order_by("orders","-id")[:constants.Footer_BANNER_LENGTH]
    serializer_class = NavModelSerializer





